/*******************************************************************************
* Copyright (C) 2019 China Micro Semiconductor Limited Company. All Rights Reserved.
*
* This software is owned and published by:
* CMS LLC, No 2609-10, Taurus Plaza, TaoyuanRoad, NanshanDistrict, Shenzhen, China.
*
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
*
* This software contains source code for use with CMS
* components. This software is licensed by CMS to be adapted only
* for use in systems utilizing CMS components. CMS shall not be
* responsible for misuse or illegal use of this software for devices not
* supported herein. CMS is providing this software "AS IS" and will
* not be responsible for issues arising from incorrect user implementation
* of the software.
*
* This software may be replicated in part or whole for the licensed use,
* with the restriction that this Disclaimer and Copyright notice must be
* included with each copy of this software, whether used in part or whole,
* at all times.
*/

/*****************************************************************************/
/** \file demo_i2c.h
**
** History:
** 
*****************************************************************************/
#ifndef __DEMO_I2C_H_
#define __DEMO_I2C_H_

#ifdef __cplusplus
extern "C"
{
#endif

/*****************************************************************************/
/* Include files */
/*****************************************************************************/
#include "cms32f033.h"
#include "stdint.h"
/*****************************************************************************/
/* Global pre-processor symbols/macros ('#define') */
/*****************************************************************************/

/*****************************************************************************/
/* Global type definitions ('typedef') */
/*****************************************************************************/

/*****************************************************************************/
/* Global variable declarations ('extern', definition in C source) */
/*****************************************************************************/


/*****************************************************************************/
/* Global function prototypes ('extern', definition in C source) */
/*****************************************************************************/
/*****************************************************************************
 ** \brief	 I2C_Master_Mode
 **			
 ** \param [in] none
 **            	
 ** \return  none
 ** \note  
 *****************************************************************************/

#ifdef OPTIC_PRESS_SENSOR
#define AW8692_RESET_PIN GPIO1->DO_f.P2
#elif defined(DEFORMATION_PRESS_SENSOR)
#define AW8692_RESET_PIN GPIO1->DO_f.P2
#endif

void I2C_Master_Mode(void);

uint8_t  AW86927_read_byte(uint8_t addr);

int8_t  AW86927_write_byte(uint8_t addr , uint8_t ch);

int8_t AW86927_read_str(uint8_t addr,  uint8_t *ch, uint16_t sizevalue);

int8_t AW86927_write_str(uint8_t addr , uint8_t *ch, uint16_t sizevalue);

#ifdef __cplusplus
}
#endif

#endif /* __DEMO_I2C_H_ */

